package cn.com.listentech;//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//


public class LEDTest {
	public LEDTest() {
	}

	public static int SetTransMode(LEDControl jc, int handle) {
		return LEDControl.SetTransMode(handle, 1, 1, 3, 1);
	}

	public static void SendFileArea() {
		LEDControl jc = new LEDControl();
		int handle = LEDControl.StartSend();
		SetTransMode(jc, handle);
		LEDControl.SetNetworkPara(handle, 1, "192.168.1.78", 10000);
		int j = LEDControl.AddControl(handle, 1, 1);
		LEDControl.AddProgram(handle, 1, 0);
		String path = "c:\\1.rtf";
		LEDControl.AddFileArea(handle, 1, 1, 0, 0, 128, 32, 0);
		LEDControl.AddFile(handle, 1, 1, 1, path, 320, 96, 32, 255, 20, 10, 1);
		LEDControl.SendControl(handle, 1, 0);
		LEDControl.EndSend(handle);
	}

	public static void SendQuietArea() {
		LEDControl jc = new LEDControl();
		int handle = LEDControl.StartSend();
		SetTransMode(jc, handle);
		LEDControl.SetNetworkPara(handle, 1, "192.168.1.78", 10000);
		int j = LEDControl.AddControl(handle, 1, 1);
		LEDControl.AddProgram(handle, 1, 0);
		String fontname = "宋体";
		String text = "每日灵粮";
		LEDControl.AddQuitText(handle, 1, 1, 0, 0, 128, 32, 255, fontname, 24, false, false, false, text);
		LEDControl.SendControl(handle, 1, 0);
		LEDControl.EndSend(handle);
	}

	public static void SendMulTiText() {
		LEDControl jc = new LEDControl();
		int handle = LEDControl.StartSend();
		System.out.println(handle);
		int j = SetTransMode(jc, handle);
		System.out.println(j);
		j = LEDControl.SetNetworkPara(handle, 1, "192.168.1.78", 10000);
		System.out.println(j);
		j = LEDControl.AddControl(handle, 1, 1);
		System.out.println(j);
		j = LEDControl.AddProgram(handle, 1, 0);
		System.out.println(j);
		j = LEDControl.AddFileArea(handle, 1, 1, 0, 0, 128, 32, 0);
		System.out.println(j);
		j = LEDControl.AddFileString(handle, 1, 1, 1, "连续左移动文本", "宋体", 12, 255, false, false, false, 1, 128, 32, 32, 255, 50, 1, 2);
		System.out.println(j);
		j = LEDControl.SendControl(handle, 1, 0);
		System.out.println(j);
		j = LEDControl.EndSend(handle);
		System.out.println(j);
	}

	public static void SendSingleLineText() {
		LEDControl jc = new LEDControl();
		int handle = LEDControl.StartSend();
		SetTransMode(jc, handle);
		LEDControl.SetNetworkPara(handle, 1, "192.168.1.78", 10000);
		int j = LEDControl.AddControl(handle, 1, 1);
		LEDControl.AddProgram(handle, 1, 0);
		LEDControl.AddLnTxtString(handle, 1, 1, 0, 0, 128, 32, "生命指南针", "宋体", 20, 255, false, false, false, 32, 10, 1);
		LEDControl.SendControl(handle, 1, 0);
		LEDControl.EndSend(handle);
	}

	public static void SendScreen() {
		LEDControl jc = new LEDControl();
		int handle = LEDControl.StartSend();
		SetTransMode(jc, handle);
		LEDControl.SetNetworkPara(handle, 1, "192.168.1.78", 10000);
		ScreenInfo sc = new ScreenInfo();
		sc.screenwidth = 128;
		sc.screenheight = 32;
		sc.dbcolor = 1;
		sc.baud = 115200;
		sc.screenname = "";
		LEDControl.SetScreenInfo(handle, sc);
		LEDControl.EndSend(handle);
	}

	public static void SendNeiMa() {
		LEDControl jc = new LEDControl();
		int handle = LEDControl.StartSend();
		SetTransMode(jc, handle);
		LEDControl.SetNetworkPara(handle, 1, "192.168.17.156", 10000);
		int j = LEDControl.AddControl(handle, 1, 1);
		LEDControl.AddProgram(handle, 1, 0);
		LEDControl.AddNeiMaTxtArea(handle, 1, 1, 0, 0, 64, 32, "生命指南针", 16, 0, 1, 0, 16, 255, 10, 10);
		LEDControl.SendControl(handle, 1, 0);
		LEDControl.EndSend(handle);
	}

	public static void main(String[] args) {
		String ls_head = "   1号窗口   2号窗口   3号窗口   4号窗口   5号窗口   6号窗口   7号窗口   8号窗口";
		int gi_handle = LEDControl.StartSend();
		String ls_ip= "192.168.17.156";
		LEDControl.SetTransMode(gi_handle, 1, 0, 3, 1);
		LEDControl.SetNetworkPara(gi_handle, 1, ls_ip,10000);
		ScreenInfo sc = new ScreenInfo();
		sc.screenwidth = 1216;
		sc.screenheight = 160;
		sc.dbcolor = 1;
		sc.baud = 115200;
		sc.screenname = "";
		LEDControl.SetScreenInfo(gi_handle, sc);
		LEDControl.AddControl(gi_handle, 1, 2);
		LEDControl.AddProgram(gi_handle, 1, 0);
		LEDControl.AddQuitText(gi_handle, 1, 1, 0, 5, 1200, 60, 255, "宋体", 30, true, false, false, ls_head);
		try {
			System.in.read();
		} catch (Exception var2) {

		}
		LEDControl.EndSend(gi_handle);
//		SendSingleLineText();
	}
}
